home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / ColorSync 2.5.1 SDK / Sample Code / CSDemo 2.5 / ShellSources / faux3DUtils.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-09  |  1.1 KB  |  55 lines  |  [TEXT/CWIE]

  1. #include "faux3DUtils.h"
  2.  
  3.  
  4. static    RGBColor        ltGray = {0xDDDD, 0xDDDD, 0xDDDD};
  5. static    RGBColor        dkGray = {0xAAAA, 0xAAAA, 0xAAAA};
  6.  
  7.  
  8. void faux3DFrameRect ( Rect *r )
  9. {
  10.         RGBForeColor( &dkGray ) ;
  11.         MoveTo (r->right-1, r->top ) ;
  12.         LineTo (r->right-1, r->bottom-1 ) ;
  13.         LineTo (r->left,    r->bottom-1 ) ;
  14.         
  15.         ForeColor(whiteColor) ;
  16.         MoveTo (r->right-1, r->top ) ;
  17.         LineTo (r->left,    r->top ) ;
  18.         LineTo (r->left,    r->bottom-1 ) ;
  19. }
  20.  
  21.  
  22. void faux3DFrameRectIn ( Rect *r )
  23. {
  24.         ForeColor(whiteColor) ;
  25.         MoveTo (r->right-1, r->top ) ;
  26.         LineTo (r->right-1, r->bottom-1 ) ;
  27.         LineTo (r->left,    r->bottom-1 ) ;
  28.         
  29.         RGBForeColor( &dkGray ) ;
  30.         MoveTo (r->right-1, r->top ) ;
  31.         LineTo (r->left,    r->top ) ;
  32.         LineTo (r->left,    r->bottom-1 ) ;
  33. }
  34.  
  35.  
  36. void faux3DFillRect ( Rect *r )
  37. {
  38.     InsetRect (r,1,1) ;
  39.     RGBForeColor( <Gray ) ;
  40.     PaintRect( r ) ;
  41.     InsetRect (r,-1,-1) ;
  42.     faux3DFrameRect ( r ) ;
  43. }
  44.  
  45. void faux3DFillRectIn ( Rect *r )
  46. {
  47.     ForeColor(whiteColor) ;
  48.     PaintRect( r ) ;
  49.     ForeColor(blackColor) ;
  50.     FrameRect( r ) ;
  51.     InsetRect (r,-1,-1) ;
  52.     faux3DFrameRectIn ( r ) ;
  53. }
  54.  
  55.